<?php
  $yhendus=new mysqli("localhost", "if13", "ifikad", "if13_keaty_e");
  
  function looRippMenyy($sqllause, $valikunimi, $valitudid=""){
     global $yhendus;
     $kask=$yhendus->prepare($sqllause);
     $kask->bind_result( $sisu);
	 echo $yhendus->error;
     $kask->execute();
     $tulemus="<select name='$valikunimi'>";
     while($kask->fetch()){
       
	   $lisand="";
       if($sisu==$valitudid){$lisand=" selected='selected'";}
       $tulemus.="<option value='$sisu' $lisand >$sisu</option>";
     }
     $tulemus.="</select>";
     return $tulemus;
  }
    function lisaruum($ruuminr){
     global $yhendus;
     $kask=$yhendus->prepare("UPDATE tsekk SET ruuminr=?
                      WHERE broneering_id=?");
	     echo $yhendus->error; 
     $kask->bind_param("i", $ruuminr, $_REQUEST["broneering_id"]);
	
     $kask->execute();
  }
  if( array_pop(explode("/", $_SERVER["PHP_SELF"]))=="abikas.php"):
?>
<?php endif ?>